<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<shiro:hasPermission name="ditchname:select">
	<div class="content1">
		<div class="header">
			<h1 class="page-title">渠道类型列表</h1>
			<ul class="breadcrumb">
				<li>渠道管理</li>
				<li class="active">渠道类型列表</li>
			</ul>
		</div>
		<div class="main-content">
			<div class="row">
				<div class="col-md-2">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">开始时间</div>
							<input class="form-control" type="date" id="beginTime" name="startTime">
						</div>
					</div>
				</div>
				
				<div class="col-md-2">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">结束时间</div>
							<input class="form-control" type="date" id="endTime" name="startTime">
						</div>
					</div>
				</div>
				
				<div class="col-md-2">
					<button type="button" class="btn btn-primary btn-small btn-block"
						id="query">
						<i class="glyphicon glyphicon-search"></i> 查询
					</button>
				</div>
				
				<div class="col-md-1">	
					<div class="form-group">
						<a class="btn btn-primary btn-small btn-block" id="customer_export" onclick="exportMessage();">导出EXCEL报表</a>
					</div>				
				</div>
				
			</div>
			<table id="example" class="table"></table>
		</div>
	<script>
		function exportMessage(){
			var href="export/ditchNameEcport.htm"
					+"?distchName="+$("#distchName").val()
					+"&countNum="+$("#countNum").val()
			$('#customer_export').attr("href",href);
		}
			//表格的初始化
			$(document).ready(function() {
				var table = $('#example').initTable({
					sAjaxSource:"ditchname/initTable.htm",
					aoColumns: [
				            { 
				              "data": "distchName",
				              "sTitle":"客户信息",
				              'sClass':"text-center"
				            },
				            { 
					              "data": "countNum",
					              "sTitle":"统计数量",
					              'sClass':"text-center"
					        }
			            ],
					 fnServerParams: function (aoData) {  //查询条件
		             	aoData.push({ "name": "beginTime", "value": $("#beginTime").val() } );
		             	aoData.push({ "name": "endTime", "value": $("#endTime").val() } );
					 
		             },
		              aoColumnDefs : [
 						<shiro:hasPermission name="ditchname:update or ditchname:delete">
			             	{"aTargets" :2,"mRender" : function(data, type, row){
				             		var edit="",del="";
		 		                    return edit+"&nbsp;"+del;
	 		                	}
	 		             	}
 		            	</shiro:hasPermission>
		             ] 
				});
				
				 $('#query').click(function(){
					$('#example').dataTable().fnDraw();
				 });
			
			});
		</script>
		<!---dialog选项-->
		<div>
			<jsp:include page="/WEB-INF/views/common/delete_dialog.jsp" />
			<jsp:include page="/WEB-INF/views/common/addupdate_dialog.jsp" />
			<div class="modal fade" id="insertAndUpdate" tabindex="-1"
				role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			</div>
		</div>
	</div>
</shiro:hasPermission>